// import request from "../utils/request";
import request from "@/utils/request";


enum Api {
  getTopListsUrl = "/getTopLists",
  getRanksUrl = "/getRanks",
  getCommentsUrl = "/getComments",
  getSongInfoUrl = "/getSongInfo",
}

/**
 * 获取榜单信息
 * @returns
 */
export const getTopListsApi = () => {
  return request.get<any, any>(Api.getTopListsUrl);
};

/**
 * 获取榜单信息
 * @param topId
 * @returns
 */
export const getRanksApi = (topId: number) => {
  return request.get<any, any>(Api.getRanksUrl + `/${topId}`);
};

/**
 * 获取评论数量
 * @param id
 * @returns
 */
export const getCommentsApi = (id: number) => {
  return request.get<any, any>(Api.getCommentsUrl + `?id=${id}`);
};

/**
 * 获取歌曲信息
 * @param mids
 * @returns
 */
export const getSongInfoApi = (mids: number) => {
  return request.post<any, any>(Api.getSongInfoUrl + `?songmid=${mids}`);
};
